package com.example.demo.exception;

import com.example.demo.utils.ExceptionMsg;
import lombok.Getter;
import lombok.Setter;

/**
 * TODO
 * 自定义业务异常
 * @author caiyonglan
 * @email 627064518@qq.com
 * @date 2020/12/2 15:49
 */
@Getter
@Setter
public class BusinessException extends RuntimeException  {
    private Integer code;
    private String msg;

    public BusinessException(ExceptionMsg exceptionMsg) {
        this.code = exceptionMsg.getCode();
        this.msg = exceptionMsg.getMsg();
    }
}
